box.info.replication
-
box.info.replication The replication section of
box.info()is a table array with statistics for all instances in the replica set that the current instance belongs to (see also “Monitoring a replica set”):In the following, n is the index number of one table item, for example
replication[1], which has data about server instance number 1, which may or may not be the same as the current instance (the “current instance” is what is responding tobox.info).replication[n].idis a short numeric identifier of instance n within the replica set. This value is stored in the box.space._cluster system space.replication[n].uuidis a globally unique identifier of instance n. This value is stored in the box.space._cluster system space.replication[n].lsnis the log sequence number (LSN) for the latest entry in instance n’s write ahead log (WAL).replication[n].upstreamappears (is not nil) if the current instance is following or intending to follow instance n, which ordinarily meansreplication[n].upstream.status=follow,replication[n].upstream.peer= url of instance n which is being followed,replication[n].lag and idle= the instance’s speed, described later. Another way to say this is:replication[n].upstreamwill appear whenreplication[n].upstream.peeris not of the current instance, and is not read-only, and was specified inbox.cfg{replication={...}}, so it is shown in box.cfg.replication.replication[n].upstream.statusis the replication status of the connection with instance n:authmeans that authentication is happening.connectingmeans that connection is happening.disconnectedmeans that it is not connected to the replica set (due to network problems, not replication errors).followmeans that the current instance’s role is “replica” (read-only, or not read-only but acting as a replica for this remote peer in a master-master configuration), and is receiving or able to receive data from instance n’s (upstream) master.stoppedmeans that replication was stopped due to a replication error (for example duplicate key).syncmeans that the master and replica are synchronizing to have the same data.
replication[n].upstream.idleis the time (in seconds) since the last event was received. This is the primary indicator of replication health. See more in Monitoring a replica set.
replication[n].upstream.peercontains instance n’s URI for example 127.0.0.1:3302. See more in Monitoring a replica set.
replication[n].upstream.lagis the time difference between the local time of instance n, recorded when the event was received, and the local time at another master recorded when the event was written to the write ahead log on that master. See more in Monitoring a replica set.replication[n].upstream.messagecontains an error message in case of a degraded state, otherwise it is nil.replication[n].downstreamappears (is not nil) with data about an instance that is following instance n or is intending to follow it, which ordinarily meansreplication[n].downstream.status=follow,replication[n].downstream.vclockcontains the vector clock, which is a table of ‘id, lsn’ pairs, for examplevclock: {1: 3054773, 4: 8938827, 3: 285902018}. (Notice that the table may have multiple pairs althoughvclockis a singular name).Even if instance n is removed, its values will still appear here; however, its values will be overridden if an instance joins later with the same UUID. Vector clock pairs will only appear if
lsn > 0.replication[n].downstream.vclockmay be the same as the current instance’s vclock (box.info.vclock) because this is for all known vclock values of the cluster. A master will know what is in a replica’s copy of vclock because, when the master makes a data change, it sends the change information to the replica (including the master’s vector clock), and the replica replies with what is in its entire vector clock table.replication[n].downstream.idleis the time (in seconds) since the last time that instance n sent events through the downstream replication.replication[n].downstream.statusis the replication status for downstream replications:stoppedmeans that downstream replication has stopped,followmeans that downstream replication is in progress (instance n is ready to accept data from the master or is currently doing so).
replication[n].downstream.messageandreplication[n].downstream.system_messagewill be nil unless a problem occurs with the connection. For example, if instance n goes down, then one may seestatus = 'stopped',message = 'unexpected EOF when reading from socket', andsystem_message = 'Broken pipe'. See also degraded state.